package com.qfedu.lc.api.user.controller;


import com.qfedu.lc.api.user.service.UserServiceFeign;
import com.qfedu.lc.common.param.UserAdd;
import com.qfedu.lc.common.param.UserLogin;
import com.qfedu.lc.common.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

@RequestMapping("/api/user")
@RestController
public class UserController {

    @Autowired
    private UserServiceFeign userServiceFeign;

    @PostMapping("/register")
    public R register(@RequestBody UserAdd userAdd){

        return   userServiceFeign.register(userAdd);

    }


    @PostMapping("/loginpass")
    public R  loginPass(@RequestBody UserLogin userLogin){

        return userServiceFeign.loginPass(userLogin);

    }

    @GetMapping("/logout")
    public R logout( ){
        return userServiceFeign.logout();

    }

}
